﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DAO;

namespace EngineeringMaster.Administrator
{
    public partial class Admin : System.Web.UI.MasterPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if(!IsPostBack)
            {
                // For debug
                Session["UserId"] = "888888";
                // End
                string userId = (string)Session["UserId"];
                UserDAO userDao = new UserDAO();
                if (! userDao.isAdministrator(userId)) 
                {
                    Response.Redirect("~/UnAuthorized.aspx");
                }
            }
            
        }
    }
}
